package pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import selenium.WebDriverWrapper;
import utils.LogTest;

/**
 * Created by Olga on 01.06.2014.
 */
public class Car extends BasePage {
    public Car(WebDriverWrapper driver) {
        super(driver, OPENED_URL);
    }

    private static final String OPENED_URL = "http://rozetka.com.ua/273290/c273290/";
   // protected final By pageLink = By.partialLinkText("Автотовары");
    protected final By pageLink = By.id("273290");


    @Override
    public void open() {
        WebDriverWait wait = new WebDriverWait(driver, 20);
        wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(pageLink)));
        LogTest.info("Car page Clicked");
        driver.findElement(pageLink).click();
    }
}
